package cluster;
import java.util.HashMap;

public class Example {

@SuppressWarnings("unchecked")
public static void main(String[] args) {

HashMap<String, String> orgMap = new HashMap<String, String>();

orgMap.put("2000", "2010");
orgMap.put("2020", "2030");
orgMap.put("2040", "2050");

HashMap<String, String> refMap = orgMap;

HashMap<String, String> cloneMap = (HashMap<String, String>) orgMap.clone();

orgMap.remove("2020");

System.out.println(" Key : 2000 " + orgMap.get("2000")
+ " Key : 2020 " + orgMap.get("2020") + " Key : 2040 "
+ orgMap.get("2040"));

System.out.println(" Key : 2000 " + refMap.get("2000")
+ " Key : 2020 " + refMap.get("2020") + " Key : 2040 "
+ refMap.get("2040"));

System.out.println(" Key : 2000 " + cloneMap.get("2000")
+ " Key : 2020 " + cloneMap.get("2020") + " Key : 2040 "
+ cloneMap.get("2040"));
}
}